<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$spages = $pages->getsubPage();
$divSub = " ";
if (count($spages) > 0) {
    for ($i = 0; $i < count($spages); $i++) {
        $imagesSubs = "";
        if ($listname == "gallery") {



            $url = $spages[$i]->getURL();
            if (strlen($spages[$i]->picture) > 3)
                $imagesSubs.="<img src='" . $HOME_URL . "resources/image.php?im=" . $spages[$i]->picture . "&s=150' title='" . $spages[$i]->category . "' alt='" . $spages[$i]->category . "' class='' />";
            $divSub.="<div class='imglist $listname'><a href='$url' title='" . $spages[$i]->category . "'>" .
                    "</a><h2 class='head'><a href='" . $url . "' title='" . $spages[$i]->category . "' >" . $spages[$i]->category . "</a></h2>
				<a href='$url' title='" . $spages[$i]->category . "'>
				" . $imagesSubs . "
                                   <br /><span class='smaller'> (" . $cquery->getResourcesPerPage($spages[$i]->contentid, 7) . " Images )</span>
</a>";


            $divSub.="
         <div class='clear'></div></div>"
            ;
        }else if ($listname == "team") {
              $url = $spages[$i]->getURL();$imagesSubs="";
              $teamPos = explode("|", $spages[$i]->category );
            if (strlen($spages[$i]->picture) > 3)
                $imagesSubs.="<img src='" . $HOME_URL . "resources/image.php?im=" . $spages[$i]->picture . "&s=143' title='" . $spages[$i]->category . "' alt='" . $spages[$i]->category . "' class='' />";
            $divSub.="<div class='imglist $listname'>
                        <a href='" . $url . "' title='" . $spages[$i]->category . "' ></a></h2>
				<a href='$url' title='" . $spages[$i]->category . "'>
				" . $imagesSubs . "
                                   <div class='team_details'><div class='white smaller bold'> " . $teamPos[0]. " </div>
                                       <div class='position medpurple smaller bold'>" . $teamPos[1]. "</div></div>
                                                    </a>
</a>";


            $divSub.="
         <div class='clear'></div></div>";
        } else {

            if (strlen($spages[$i]->picture) > 3)
                $imagesSubs.="<img src='" . $HOME_URL . "resources/image.php?im=" . $spages[$i]->picture . "&s=150' title='" . $spages[$i]->category . "' alt='" . $spages[$i]->category . "' class='imgleft' />";

            $url = $spages[$i]->getURL();

            $divSub.="<div class='cat_list $listname'><a href='$url'>" . $imagesSubs .
                    "</a><h2><a href='" . $url . "' title='" . $spages[$i]->category . "' >" . $spages[$i]->category . "</a></h2>";
            $divSub.=" " . $spages[$i]->getPageExtraInfo() . $spages[$i]->summary . "
                <a href='" . $url . "' class='readmore' title='Read more about " . $spages[$i]->category . "'>readmore</a>
         <div class='clear'></div></div>"
            ;
        }
    }
}
echo "" . $pageNav->getPageRange() . $divSub . $pageNav->getNavigator();
?>
